perm filename MIX.RES[UP,DOC] blob
sn#257947 filedate 1977-01-14 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00014 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 MM MM II XX XX
C00004 00003 SUMMARY
C00007 00004 DETAILS
C00008 00005 buttons for machine operation:
C00011 00006 buttons for finding out about the status of MIX:
C00016 00007 buttons for doing things about i/o:
C00019 00008 buttons used for tracing:
C00022 00009 buttons for MIXAL:
C00024 00010 buttons for the debugger:
C00029 00011 DETAILS
C00036 00012 A SAMPLE RUN:
C00038 00013 To anyone interested in debugging MIX or MIXAL:
C00039 00014 *************************
C00045 ENDMK
C⊗;
MM MM II XX XX
MMM MMM II XX XX
MMMM MMMM II XX XX
MM MM MM MM II XX XX
MM MM MM MM II XX XX
MM MM MM MM II XX XX
MM MMM MM II XXX
MM M MM II XXX
MM MM II XX XX
MM MM II XX XX
MM MM II XX XX
MM MM II XX XX
MM MM II XX XX
MM MM II XX XX
SUMMARY
MIX is a simulator for the MIX machine described in Knuth,
vol. 1. It has all the features described there, except that it
cannot do floating point arithmetic, and I/O is limited to a card
reader, card punch, printer, and typewriter. It has a byte size of
64.
MIX is actually a system of three major parts. One is the
actual simulator. The second is the debugging package, which allows
the user to examine and change loactions in core, set breakpoints,
and perform other useful functions. The third is an assembler for
the MIXAL assebly language (a free-format version of the language
described in Knuth.) MIX incorporates all three parts into one
program. The upper-level of this program is the simulator, and the
user can call either of the other parts by pushing any of numerous
"buttons" provided on the machine. For convenience, MIXAL may be run
separately, without calling the simulator.
MIX is loaded by typing to the monitor:
R MIX
MIXAL alone is loaded by typing to the monitor:
R MIXAL
NOTE: In files input to MIXAL, E directory pages are not ignored and will
result in assembly errors. Use the /N switch in E to edit without a
directory page being written on the disk, or else delete the directory
page before running MIXAL.
NOTE: Updates to this manual have been added at the end.
DETAILS
about MIX:
MIX is the simulator with the debugger and MIXAL assembler
incorporated into it. Essentially, it is simply a machine with a
large number of buttons which you can push. These buttons allow you
to tell the machine to do various things. MIX will tell you it is
waiting for a button to be pushed by typing "#". You push a button
by typing the name of the button followed by a carriage-return. Some
buttons have abbreviations. The different buttons may be grouped
into several different types. The buttons of each type, and MIX's
response, are described below.
buttons for machine operation:
GO or G This button causes one card to be read into
locations 0-15. Then execution begins at
location 0000.
LOAD or L This button causes one card to be read into
locations 0-15. Then control returns to the
user.
START or S This button causes the execution time to be
set to zero and rJ to be set to zero. Then
execution begins at location 0000.
CONT or C This button causes execution to be resumed at
the location indicated by the program
counter. (This works after halting,
breakpointing, or stopping for any reason.)
HALT or H This doesn't do anything except return
control to the user, where control already
was. If you wish to stop the machine while it
is running, type any character at all. This
will cause MIX to stop as soon as the present
instruction is finished.
STEP or X This button causes the next instruction (as
indicated by the program counter) to be
executed. Control then returns to the user.
ZXT This button causes the execution time to be
set to zero.
ZPC This button causes the program counter to be
set to 0000.
SETPC This button is used to set the program
counter to whatever you want. When MIX asks
for it, type the address you want the program
counter to be set to.
EXIT This button causes MIX to exit, and your
teletype is returned to monitor mode.
buttons for finding out about the status of MIX:
Note: If you are at a III display, then you will see before you a
picture of the MIX machine. It shows each of the registers, the
execution time, the program counter (which will be the next
instruction executed in the normal flow of control), the instruction
which was just executed, and the overflow and comparison indicators.
If you are not at a III display, I'm sorry, but you can't see the
picture, you can only read the book.
DISP or D This button causes a type out giving
information about the MIX machine. The
information shown is the execution time, the
value of MC0000 (which is equivalent to
location 0000 of the simulated MIX memory),
the value of the program counter as an
absolute address (from which you subtract
(octally) the value of MC0000, to get the
octal equivalent of the real program
counter), the rA, rX, and rJ registers, and
the instruction most recently executed (all
of these in byte format with octal
expressions for the bytes).
MEM or M This button allows you to find out the
contents of any location in MIX's simulated
core. When asked for it, you type the
decimal address you would like to look at,
followed by a carriage-return. The contents
of that location, in octal byte format, will
be typed out. You may keep doing this for as
many locations you wish to examine. When you
wish to leave MEM mode, type X (must be
capital X) followed by a carriage-return.
UPDATE This button causes the display of MIX to be
updated. (This is only useful at a III
display, and then it isn't really, since the
display is updated just before each # is
typed.)
SETUP This button allows you to vary the number of
executed instructions between updates of the
screen. Normally, the display is updated
after every instruction is executed.
However, this slows the program down
considerably. So you may wish to have the
display updated less often. After being
prompted by MIX, you should type the number
of instructions (decimal) that you wish
executed between updates (10 to 30 are
reasonable numbers if you want to see things
happening, but still not slow the machine too
much.) If you type the number 0, the screen
will not be updated until MIX returns to
button mode, whenever that may be.
buttons for doing things about i/o:
Note: All I/O for MIX (except for the typewriter) is done with
files rather than with devices. Thus, the card reader, the card
punch, and the printer are really files. So, to turn on a device,
you give MIX a file name. The syntax for filenames is:
<name>.<ext>[prj,prg], where <ext> and [prj,prg] are optional. Each
device has two buttons, one to turn it on (get a filename) and the
other to turn it off (close the file). Typewriter I/O is naturally
done on the teletype.
READ This button turns on the card reader. After
prompting from MIX, you should type the file
to be used for input.
READX This button closes the file for the card
reader, so it really turns off the card
reader.
PUNCH This button turns on the card punch. After
prompting from MIX, you should type the file
to be used for output.
PNCHX This button closes the file for the card
punch, so it really turns off the card punch.
PRINT This button turns on the printer. After
prompting from MIX you should type the file
to be used for output.
PRNTX This button closes the file for the printer,
so it really turns off the printer.
buttons used for tracing:
Note: You may wish to have a trace showing the status of MIX at
each stage of a given run. MIX has such a tracing feature. It will
create a file which shows the status of MIX after each instruction
has been executed. However, you must specify an upper limit to the
number of times each particular instruction will be shown. You also
get a dump of all non-zero locations in core. This happens
automatically after each HLT instruction is executed. Also note that
since the byte size is 64, rather than 100, decimal printouts don't
show byte break-downs very well. All printouts are in decimal with
the following exceptions: the INSTRUCTION is shown in standard
instruction format (+AA,I,F,C), without spaces between the byte
groupings; the CONTENTS are shown broken into byte groupings as
indicated by the F-field of the instruction, with spaces surrounding
the bytes which are designated by the F-field (between the spaces is
one decimal number). The O and C columns show the Overflow and
Comparison indicators respectively.
TRACE This button is used to open up the trace
file. After prompting from MIX, you should
type the name of the file you want the trace
written onto. After further prompting, you
should type the maximum number (decimal) of
times each location may be traced. Tracing
will begin immediately after this button is
pushed.
TK This button is used to change the maximum
number of traces per location. Note that 0
effectively turns off the trace.
DUMP This button causes an immediate dump of all
non-zero locations in MIX's simulated core.
It is the same as you get automatically after
a HLT is executed.
TRACX This button causes tracing to stop and the
file to be closed.
buttons for MIXAL:
Note: See the section about MIXAL for more details about the
language.
MIXAL This button causes a MIXAL source file to be
assembled. You will be asked for a name and
you should give it one. If it types *****
and you have seen no error messages, you
should be O.K. Your assembled program will
NOT be loaded. A <name>.LST file and a
<name>.MLD file will be created. The .LST
file is a listing and the .MLD file is for
loading into MIX.
MIXLOAD or MLD This button is for loading a .MLD file into
MIX's simulated core. You must give it a
filename, but since the extension will
probably be MLD, you may omit it and it will
be assumed to be there. The program counter
is set to the value indicated in your END
statement and the symbol table is loaded for
use by the debugger. You may execute your
program at this point by pushing the CONT
button.
PCMLD This button causes the program counter to be
reset to the starting address of the most
recently loaded MLD file.
buttons for the debugger:
Note: All buttons for the debugger have <alt-mode> as the first
character. This is indicted in the descripions by $. All addresses
may be absolute or symbolic (referring to symbols in the most
recently loaded MLD file). All instructions may be symbolic using the
standard MIXAL op-codes. Pseudo-ops are, of course, not permitted.
These buttons have a strange syntax, in that the button name is
followed by some string. Don't let that bother you. Also, it is
important to know that anytime the symbols RA, R1, R2, R3, R4, R5,
R6, RX, RJ are encountered they will be considered to be referring to
the appropriate registers of MIX rather than to any symbol in your
program. Thus, you probably shouldn't use these as symbols in your
program since you will not be able to refer to them symbolically.
Another important symbol to know about is *. When not used as a
multiply operator, it refers to a special address. This address is
the most recently referred to address in a $E, $D, $B, $U, or $=
command. Any command which refers to a register will not affect the
value of *. * may be used wherever a symbol is permitted. All
expressions are in the standard MIXAL format.
$B address
This sets a breakpoint at this address.
$U address
This removes the breakpoint at this address if there
is one.
$U
This removes all breakpoints.
$E address
This displays, in symbolic instruction mode, the
contents of the core location with this address.
$EN address
This displays, in numeric instruction mode, the
contents of the core location with this address.
$ES address
This displays, in symbolic decimal mode, the contents
of the core location with this address.
$ED address
This displays, in decimal mode, the contents of the
core location with this address.
$EB address
This displays, in byte mode, the contents of the core
location with this address.
$EA address
This displays, in ALF mode, the contents of the core
location with this address.
$<line-feed>
This displays the contents of the core location with
the address *+1 in the same mode as most recently
used to display some other address.
$DW address←W-value
This causes this W-value to be deposited into the
core location with this address.
$DI address←instruction
This causes this instruction to be deposited into the
core location with this address.
$=S address
This causes the symbolic equivalent of this address
(the address itself, not the contents of any core
location) to be displayed.
$=D address
This causes the decimal equaivalent of this address
(the address itself, not the contents of any core
location) to be displayed.
$J address
This causes execution of MIX instructions to begin at
the core location with this address.
$X instruction
This causes this instruction (the instruction itself,
not the instruction at any particular core location)
to be executed.
DETAILS
about MIXAL:
The version of MIXAL used here is quite similar to that described in
Knuth, but is a free-format version. That is, extra spaces may occur
in weird places without making any significant difference. Also,
there may be only one statement to a line. The major differences
with a standard version to worry about are:
(1) remarks in non-comment lines must be preceded by a ";".
(2) in an ALF statement, there must be exactly one character
(which may be a <tab>) between ALF and the five
characters which are the constant.
(3) if the LOC field is supposed to be empty, there must be
either a <space> or a <tab> as the first character in
the line.
(4) SOS line numbers and page marks are ignored by the
assembler, except when printing error messages.
NOTE: E directory pages are not ignored and will result in assembly
errors. Use the /N switch in E to edit without a directory page being
written on the disk, or else delete the directory page before running
MIXAL.
During the assembly process, two files are created:
(1) filename.LST this is a listing of your program.
(2) filename.MLD this is the file to load into the
simulator.
There are a couple of things to say about the program.
Mostly about the file called "filename.LST". This file contains a
listing of your program along with the assembled program. The
assembled program appears on the left side of the page. The first
thing is the value of "*" before the line is assembled. This is the
address which is given to symbols in the LOC field, and the place
where assembled code is put. If this address is invalid (i.e.: less
than 0 or greater than 3999), then four asterisks are put where the
address would normally appear. Next, there may appear a couple of
little arrows. A "↓" means that the address portion of the
instruction contains a future-reference. A "←" means that a symbol
is defined on this line, and that symbol was used previously as a
future-reference. Then comes the assembled word to be loaded into
the MIX machine. This word is split into byte-groupings in a manner
which is appropriate for the circumstances. If there were any
errors, they are indicated on the next line by numbered codes in the
order in which they occurred. The numbered codes are as follows:
1 - error on output
2 - illegal operator
3 - syntax error
4 - error on input
5 - no "=" after literal: ignore all till I find it
6 - illegal character: ignored
7 - error in expression: value set to zero
10 - bad F-part: assumed to be (0:5)
11 - error in W-value: assumed to be 0
12 - invalid LOC field
13 - some error in or after address-field
14 - should be end-of-line: will try to find it
15 - error in or after index-field
16 - error in or after field-field
There are a few differences between this version and that
which lives in Stanford's 360. The most notable is that undefined
symbols at the end of the program are put in after the END statement
(in fact, while listing the symbol table), not immediately preceeding
the END statement. The two have a different effect only if there is
a label on the END statement, in which case the PDP-10 version
doesn't define it again, whereas the 360 version will have a
duplicated label error on the END statement.
Other differences include stuff about the symbol names.
Symbol names may be as long as you want, but only the first twelve
characters will be used. There are no special characters allowed as
characters in symbols (f'rinstance, you can't use % or $). Literals
are given the symbol name "=LIT= ", for the first six chars, and the
next six chars are the evaluated MIX word which is equivalent to the
symbol. Thus, if you use two literals which both evaluate to the
same MIX word, they will be the same symbol. Local symbols are given
the symbol name "iLOCAL" for the first six chars, and the next six
chars are actually the number of the occurrence of "iH" which is
referred to.
A SAMPLE RUN:
It may be helpful to show what commands might be used to give
a simple, but complete, run of a program written in MIXAL. Let's
assume that you have a MIXAL program on a file called PEACE. (I will
indicate what you type in small letters, and what MIXAL or MIX types
in capital letters.) Here we go:
.r mixal
MIXAL
FILENAME FOR INPUT: peace
*****
EXIT
↑C
[let's suppose that at this point you discover that you made a minor
error in your program: at location START+7 you had ENT1 X+3,4 and
you meant to have ENT2 X+3,4. however, rather than reassemble the
whole program, you decide to change it after it is loaded.]
.r mix
#trace
FILE FOR TRACE OUTPUT: peace.tra
MAXIMUM PRINT TIME = 2
#print
FILE FOR PRINTER OUTPUT: peace.prn
#mld
MIX-LOAD FILE: peace.mld
#$e start+7
ENT1 X+3,4
#di *←ent2 x+3,4
#$e *
ENT2 X+3,4
#c
#HALT#
#exit
EXIT
↑C
.
To anyone interested in debugging MIX or MIXAL:
The files MIX and MIXAL are command files which can be used to load
MIX and MIXAL. Thus,
LOAD @MIX loads MIX
LOAD @MIXAL loads MIXAL
All the files of interest to MIX users are found on [MIX,SYS] on the
system UDP.
*************************
A few fixed bugs:
1. Data Disk Displayed instruction now has a maximum offset of 63
when symbolically giving an address.
2. Entire Data Disk screen moved down a line so that EX TIME doesn't
remain after execution.
3. DISPLAY or D Button now does more reasonable things (of principle
interest to those running from teletypes).
4. SETPC nnn now works as advertised instead of killing the job.
*************************
New system up.
FIXED BUGS:
1. No more ILL MEM REF on obscure ENTi and ENNi cases
2. No looping when examining locations with negative addresses
FEATURES:
1. PC given on error messages
2. Next instruction symbolically displayed
3. Optional halting on "non-fatal" errors. New buttons:
ERRHALT and ERRGO
4. "I/O to uninitiated device" error resets PC to address of
instruction so that device can be opened and execution
continued using "CONTINUE" button.
5. Buttons which request a file name (MIXAL,MLD,READ,PUNCH,
PRINT,TRACE) or a number (SETUP,SETPC,TK) will take
this argument from the line containing the button
name if it is there. (i.e., you can now say SETUP 100)
*************************
As you will soon be able to tell, there is a new version of
MIX up. Most notable feature is the Data Disk display routines.
Now, if you are running from a DD, you get the same information
that you get on a III, only in a more compact form. I strongly
recommend that you use an update count (via the SETUP button) of
0. There is a new button. <control><form feed> will cause the
complete screen to be rewritten if you are on a DD. This can be
useful if your DD screen goes away. If you encounter troubles,
the old version is on the system UDP as MIX.OLD[MIX,SYS].
*************************
This is file NEWS.MIX[MIX,SYS] and is typed out (if it exists) whenever
MIX is run. I will use it to keep you informed of corrections and
additions, and you can perhaps use it to warn one another of bugs before
I get a chance to correct them. Let's try to keep the size of this file
down, but still keep one another informed.
NEW FEATURES
New buttons:
NOEJECT Produce print files that will write over perforations.
You can get them out by saying SPOOL <file>/B
EJECT Get back to normal
NEWS Type out this file again
FIXED BUGS
MIX will now read SOS files for card data without screwing up and reading
the line number of the first card of the second physical block (card
19 usually for the crossword puzzle data)
MIX will accept files on other people's areas for all files that it gives
a prompt for. (Who says you can't use a preposition to end a sentence
with?)
*************************
Several changes, primarily with TRACE and DUMP routines:
1. TRACE now shows register condition before instruction execution
just like the campus system does.
2. The "contents", rA, and rX contents are given bytewise instead
of as large integers.
3. Without much trouble, optional formats could be used.
4. DUMP allows a range to be specified, and a format for the non-
executed locations. See RES for details.